<!DOCTYPE html>
<html>
<head>
<meta charset="<?php echo $cfg_soft_lang; ?>">
<title><?php echo $cfg_softname; ?></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="../publics/layui/css/layui.css" media="all" />
<link rel="stylesheet" href="../publics/iconfont/iconfont.css" media="all" />
<link rel="stylesheet" href="css/admin.css" media="all" />
<script language="javascript" src="js/context_menu.js"></script>
<script language="javascript" src="js/ieemu.js"></script>
<script language="javascript">
if(moz) {
	extendEventObject();
	extendElementModel();
	emulateAttachEvent();
}
function viewArc(aid){
	if(aid==0) aid = getOneItem();
	window.open("archives_do.php?aid="+aid+"&dopost=viewArchives");
}
function editArc(aid){
	if(aid==0) aid = getOneItem();
	location="archives_do.php?aid="+aid+"&dopost=editArchives";
}
function updateArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives_do.php?aid="+aid+"&dopost=makeArchives&qstr="+qstr;
}
function checkArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives_do.php?aid="+aid+"&dopost=checkArchives&qstr="+qstr;
}
function adArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives_do.php?aid="+aid+"&dopost=commendArchives&qstr="+qstr;
}
function delArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives_do.php?qstr="+qstr+"&aid="+aid+"&dopost=delArchives";
}
//上下文菜单
function ShowMenu(evt,obj,aid,atitle)
{
  var eobj,popupoptions
  popupoptions = [
    new ContextItem("浏览文档",function(){ viewArc(aid); }),
    new ContextItem("编辑文档",function(){ editArc(aid); }),
    new ContextSeperator(),
    new ContextItem("更新HTML",function(){ updateArc(aid); }),
    new ContextItem("审核文档",function(){ checkArc(aid); }),
    new ContextItem("推荐文档",function(){ adArc(aid); }),
    new ContextSeperator(),
    new ContextItem("删除文档",function(){ delArc(aid); }),
    new ContextSeperator(),
    new ContextItem("全部选择",function(){ selAll(); }),
    new ContextItem("取消选择",function(){ noSelAll(); }),
    new ContextSeperator(),
    new ContextItem("关闭菜单",function(){})
  ]
  ContextMenu.display(evt,popupoptions)
}

//获得选中文件的文件名
function getCheckboxItem()
{
	var allSel="";
	if(document.form2.arcID.value) return document.form2.arcID.value;
	for(i=0;i<document.form2.arcID.length;i++)
	{
		if(document.form2.arcID[i].checked)
		{
			if(allSel=="")
				allSel=document.form2.arcID[i].value;
			else
				allSel=allSel+"`"+document.form2.arcID[i].value;
		}
	}
	return allSel;	
}

//获得选中其中一个的id
function getOneItem()
{
	var allSel="";
	if(document.form2.arcID.value) return document.form2.arcID.value;
	for(i=0;i<document.form2.arcID.length;i++)
	{
		if(document.form2.arcID[i].checked)
		{
				allSel = document.form2.arcID[i].value;
				break;
		}
	}
	return allSel;	
}

function selAll()
{
	for(i=0;i<document.form2.arcID.length;i++)
	{
		if(!document.form2.arcID[i].checked)
		{
			document.form2.arcID[i].checked=true;
		}
	}
}
function noSelAll()
{
	for(i=0;i<document.form2.arcID.length;i++)
	{
		if(document.form2.arcID[i].checked)
		{
			document.form2.arcID[i].checked=false;
		}
	}
}
</script>
</head>
<body class="childrenBody">
<div class="x-nav">
	<span class="layui-breadcrumb">
	  <a href="index_body.php">首页</a>
	  <a><cite>专题列表</cite></a>
	</span>
	<a class="layui-btn layui-btn-sm refresh" href="javascript:location.replace(location.href);" title="刷新"><i class="iconfont icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-mt-10">
	<div class="layui-inline">
		<a class="layui-btn layui-btn-sm layui-btn-normal" href="spec_add.php"><i class="layui-icon">&#xe61f;</i>添加专题</a>
	</div>
	<div class="layui-inline">
		<a class="layui-btn layui-btn-sm" href="makehtml_spec.php"><i class="layui-icon">&#x1005;</i>更新专题HTML</a>
	</div>
	<form name='form3' action='content_s_list.php' method='get' class="layui-form layui-form-pane" style="float:right;">
		<input type='hidden' name='dopost' value='listArchives'>
		<div class="layui-form-item">
			<div class="layui-input-inline">
				<select name='cid'>
				<option value='0'>选择栏目...</option>
				{dede:global.optionarr /}
				</select>
			</div>
			<label class="layui-form-label">关键字</label>
			<div class="layui-input-inline">
				<input type="text" name='keyword' value='{dede:global.keyword/}' placeholder="标题" autocomplete="off" class="layui-input">
			</div>
			<div class="layui-input-inline" style="width:80px">
				<button class="layui-btn" type="submit"><i class="layui-icon">&#xe615;</i></button>
			</div>
		</div>
	</form>
</div>
<div class="layui-form news_list">
<form name="form2">
	<table class="layui-table">
		<colgroup>
			<col width="60">
			<col width="5%">
			<col>
			<col width="8%">
			<col width="8%">
			<col width="6%">
			<col width="6%">
			<col width="8%">
			<col width="6%">
			<col width="15%">
		</colgroup>
		<thead>
			<tr>
				<th>选择</th>
				<th>ID</th>
				<th style="text-align:left;">文章标题</th>
				<th>发布时间</th>
				<th>所属栏目</th>
				<th>点击</th>
				<th>HTML</th>
				<th>浏览权限</th>
				<th>发布人</th>
				<th>操作</th>
			</tr> 
		</thead>
		<tbody class="news_content">
			{dede:datalist}
			<tr>
				<td><input type="checkbox" name="arcID" id="arcID" value="{dede:field.id/}" lay-ignore></td>
				<td>{dede:field.id/}</td>
				<td align="left"><a href="archives_do.php?aid={dede:field.id/}&dopost=editArchives">{dede:field.title/}</a> {dede:field.flag function='IsCommendArchives(@me)'/}</td>
				<td>{dede:field.senddate function='GetDateMk(@me)'/}</td>
				<td><a href="content_list.php?cid={dede:field.typeid/}">{dede:field.typeid function='GetTypename(@me)'/}</a></td>
				<td>{dede:field.click/}</td>
				<td>{dede:field.ismake function="IsHtmlArchives(@me)"/}</td>
				<td>{dede:field.arcrank function="GetRankName(@me)"/}</td>
				<td>{dede:field.mid function=GetMemberName(@me)/}</td>
				<td>
				<a class="layui-btn layui-btn-sm" href="archives_do.php?aid={dede:field.id/}&dopost=editArchives"><i class="iconfont icon-edit"></i> 编辑</a>
				<a class="layui-btn layui-btn-normal layui-btn-sm" onClick="QuickEdit({dede:field.id/}, event, this);"><i class="layui-icon">&#xe631;</i> 属性</a>
				<a class="layui-btn layui-btn-primary layui-btn-sm" onClick="viewArc({dede:field.id/});"><i class="layui-icon">&#xe609;</i> 预览</a>
				</td>
			</tr>
			{/dede:datalist}
<tr>
<td align="left" colspan="10" style="padding-left:0;">
	&nbsp;
	<a href="javascript:selAll()" class="layui-btn layui-btn-sm">全选</a> 
	<a href="javascript:noSelAll()" class="layui-btn layui-btn-sm">取消</a> 
	<a href="javascript:viewArc(0)" class="layui-btn layui-btn-sm">&nbsp;查看&nbsp;</a> 
	<a href="javascript:editArc(0)" class="layui-btn layui-btn-sm">&nbsp;更改&nbsp;</a> 
	<a href="javascript:updateArc(0)" class="layui-btn layui-btn-sm">&nbsp;更新&nbsp;</a> 
	<a href="javascript:checkArc(0)" class="layui-btn layui-btn-sm">&nbsp;审核&nbsp;</a> 
	<a href="javascript:adArc(0)" class="layui-btn layui-btn-sm">&nbsp;推荐&nbsp;</a> 
	<a href="javascript:delArc(0)" class="layui-btn layui-btn-sm layui-btn-danger">&nbsp;删除&nbsp;</a> 
</td>
</tr>
		</tbody>
	</table>
</form>
	<div id="page">
		<div class="layui-box layui-laypage layui-laypage-default">
			{dede:pagelist listsize=3/}
		</div>
	</div>
</div>
<script type="text/javascript" src="../publics/layui/layui.js"></script>
<script type="text/javascript" src="js/alllist.js"></script>
</body>
</html>